package com.pagonxt.hal.platform.modules.manager;

import com.pagonxt.hal.emv.emvService.IEMVInterface;
import com.pagonxt.hal.platform.service.beeper.IBeeperService;
import com.pagonxt.hal.platform.service.camera.ICameraService;
import com.pagonxt.hal.platform.service.card.ICardService;
import com.pagonxt.hal.platform.service.encryption.IEncryptionInterface;
import com.pagonxt.hal.platform.modules.impl.beep.BeepServiceImpl;
import com.pagonxt.hal.platform.modules.impl.camera.CameraServiceImpl;
import com.pagonxt.hal.platform.modules.impl.card.CardServiceImpl;
import com.pagonxt.hal.platform.modules.impl.emv.EmvImpl;
import com.pagonxt.hal.platform.modules.impl.encryption.EncryptionImpl;
import com.pagonxt.hal.platform.modules.impl.led.LedServiceImpl;
import com.pagonxt.hal.platform.modules.impl.maintenance.MaintenanceImpl;
import com.pagonxt.hal.platform.modules.impl.mifare.MifareServiceImpl;
import com.pagonxt.hal.platform.modules.impl.stat.StatServiceImpl;
import com.pagonxt.hal.platform.service.info.IInfoService;
import com.pagonxt.hal.platform.service.init.IInitService;
import com.pagonxt.hal.platform.service.led.ILedService;
import com.pagonxt.hal.platform.service.maintenance.IMaintenanceInterface;
import com.pagonxt.hal.platform.service.mifare.IMifareService;
import com.pagonxt.hal.platform.service.printer.IPrinterService;
import com.pagonxt.hal.platform.modules.impl.info.InfoServiceImpl;
import com.pagonxt.hal.platform.modules.impl.init.InitServiceImpl;
import com.pagonxt.hal.platform.modules.impl.print.PrintServiceImpl;
import com.pagonxt.hal.platform.service.stat.IStatService;

public class ModuleManager implements IModuleManager {

    private IInfoService infoService;
    private IInitService initService;
    private IPrinterService printerService;
    private IBeeperService beeperService;
    private ICameraService cameraService;
    private ICardService cardService;
    private ILedService ledService;
    private IMifareService mifareService;
    private IStatService statService;
    private IEMVInterface emvInterface;
    private IMaintenanceInterface maintenanceInterface;
    private IEncryptionInterface encryptionInterface;


    private ModuleManager(){
        infoService = new InfoServiceImpl();
        initService = new InitServiceImpl();
        printerService = new PrintServiceImpl();
        beeperService = new BeepServiceImpl();
        cameraService = new CameraServiceImpl();
        cardService = new CardServiceImpl();
        ledService = new LedServiceImpl();
        mifareService = new MifareServiceImpl();
        statService = new StatServiceImpl();
        emvInterface = new EmvImpl();
        maintenanceInterface = new MaintenanceImpl();
        encryptionInterface = new EncryptionImpl();
    }

    @Override
    public IInitService getInit() {
        return initService;
    }

    @Override
    public IPrinterService getPrinter() {
        return printerService;
    }

    @Override
    public ILedService getLed() {
        return ledService;
    }

    @Override
    public IBeeperService getBeeper() {
        return beeperService;
    }

    @Override
    public ICardService getCard() {
        return cardService;
    }

    @Override
    public IMifareService getMifare() {
        return mifareService;
    }

    @Override
    public ICameraService getCamera() {
        return cameraService;
    }

    @Override
    public IInfoService getInfo() {
        return infoService;
    }

    @Override
    public IStatService getStatistic() {
        return statService;
    }

    @Override
    public IEMVInterface getEmv() {
        return emvInterface;
    }

    @Override
    public IMaintenanceInterface getMaintenance() {
        return maintenanceInterface;
    }

    @Override
    public IEncryptionInterface getEncryption() {
        return encryptionInterface;
    }

    public static IModuleManager getInstance() {
        return Holder.INSTANCE;
    }

    static class Holder {
        private static final IModuleManager INSTANCE = new ModuleManager();
    }
}
